#ifndef _BIK_GAMEWORLD_H_
#define _BIK_GAMEWORLD_H_

#include "background/bg_scene.h"
#include "math/counter.h"
#include "well/game_end.h"


namespace vfs
{
	struct LoadedBlock;
};




class BIKGameWorld 
{
public:	
	

	BIKGameWorld ();
	~BIKGameWorld ();
	void					Load(const std::string& File);
	void					LoadFromMemory(vfs::LoadedBlock& Block);
	void					Save(const std::string& File);
	void					Init();
	void					InitUI();
	void					Shutdown();
    void					ShutdownUI();
	void					Clear();
	void					Render();
	void					RenderUI();
	void					Tick(float dt);

	//PVUGameEditor*		GetEditor()		{ return m_pEditor; };
	background::BGScene&	GetBG() { return m_BG; };
	math::Vec2				GetScrollOffset() { return m_BG.GetOffset(); };
	float					GetScale() const { return m_Scale; };
	void					SetScale(float f);
	math::Vec2				ScreenToWorld(const math::Vec2& Screen);

	
	// input
	virtual void			KeyPressed(input::Keyboard::KEY* pKey);
	virtual void			KeyDown(input::Keyboard::KEY* pKey);
	virtual void			MouseMove(const math::Vec2& From, const math::Vec2& To);
	virtual	void			MouseButtonPressed(input::Mouse::BUTTON_STATE* pKey, const math::Vec2& Pos);
	virtual	void			MouseButtonReleased(input::Mouse::BUTTON_STATE* pKey, const math::Vec2& Pos);
	virtual void			MouseButtonDown(input::Mouse::BUTTON_STATE* pKey, const math::Vec2& Pos);
	virtual void			MouseOnDrag(const math::Vec2& From, const math::Vec2& To) ;
	virtual void			MouseOnDrop(const math::Vec2& From, const math::Vec2& To) ;
	virtual void			MouseWheelMove(int WheelInfo, const math::Vec2& Pos);
	

	void					RenderDebug();

	void					LevelComplete();
	void					RestartLevel() { Load(m_File); };
	//PVULevelSelect*		GetLevelSelect() { return m_pLevelSelect; };
	void					LoadLastEdit();
	
	
private:
	void						MouseScroll(float dt);
	
	
	//PVUGameEditor*			m_pEditor;
	background::BGScene			m_BG;
	float						m_Scale;
	math::Vec2					m_CurrentPos;
	math::Vec2					m_FocusPoint;
	//PVUGameUI*				m_pUI;
	bool						m_RenderDebug;

	//PVULevelSelect*			m_pLevelSelect;
	std::string					m_Help;
	bool						m_ShowHelp;
	//PVULevelComplete*			m_pLevelComplete;

	std::string					m_File;
};

#endif // _BIK_GAMEWORLD_H_